<%@ page language="java" contentType="text/html; charset=utf-8"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>联合高级搜索</title>
	<style>
		td {font-size: 12px;line-height: 18px}
	</style>
	<link href="css/main.css" rel="stylesheet" type="text/css" />
	<link href="css/suggest.css" rel="stylesheet" type="text/css" />
	
	<script language="javascript" type="text/javascript">
	var expanded = false;
	function valid()
	{
		var alltext = document.getElementById("includeAllKey");
		var anytext = document.getElementById("includeAnyKey");
		var excludetext = document.getElementById("excludeKey");
		if((alltext.value != null && alltext.value != "") || (anytext.value != null && anytext.value != ""))
		{
			
			var url = "content.jsp?";
			var text = "";
			var perPage = document.getElementById("termNum").value;
			var span = document.getElementById("timeSpan").value;
			var position;
			var tmp = document.getElementsByName("searchPosition");
			var i=0;
			var length = tmp.length;
			while(i<length)
			{
				if(tmp[i].checked == 1)
				{
					position = i;
					break;
				}
				i++;
			}
			var site = document.getElementsByName("searchSite")[0];
			if(alltext.value != null && alltext.value != "")
				text = alltext.value;
			if(anytext.value != null && anytext.value != "")
				text += "or:"+anytext.value;
			if(excludetext.value != null && excludetext.value != "")
				text += "not:"+excludetext.value;
			switch(position)
			{
				case 0:
					break;
				case 1:
					text = "title:"+text;
					break;
				case 2:
					text = "url:"+text;
					break;
				case 3:
					text = "content:"+text;
					break;
			}
			if(site.value != null && site.value != "")
			{
				text = text + " site:"+site.value;
			}
			url += "searchText="+encodeURI(text);
			url += "&page=0&perPage="+perPage;
			url += "&hs=0";
			url += "&flag=-1";
			url += "&span="+span;
			document.form4.action=url;
			document.form4.submit();
			return true;
		}
	  	else
	  	{
	  		alert("请输入查询关键字!");
	  	 	return false;
	  	}
	}
	
	function clickradio(url)
	{
		document.getElementsByName("searchSite")[0].value = url;
	}
	
	function ExpandGx()
	{
		if(expanded == false)
		{
			document.getElementById("gxnode").style.display="block";
			document.getElementById("buttonGX").value ="指定站点<<";
			expanded = true;""
		}
		else
		{
			document.getElementById("gxnode").style.display="none";
			document.getElementById("buttonGX").value ="指定站点>>";
			expanded = false;
		}
		return false;
	}
	</script>
</head>

<body>
	<form  name="form4" method="post" onsubmit="return valid()">
		<div align="center">
			<div id="logo" align="center">
				<a href="./default.jsp"><img src="images/logo.jpg" border="0">
				</a>
			</div>
		</div>

		<table width="600" align="center">
			<tr>
				<td width="100%">
				</td>
				<td>
					<div id="mid">
						<div id="midcontent">
							<table>
								<tr>
									<td width="100">
									</td>
									<td>
										<font size="3"><strong>高级搜索</strong> </font>
									</td>
								</tr>
							</table>

							<table>
								<tr>
									<td width="100">
									</td>
									<td width="140">
										<b>搜索结果</b>
									</td>
									<td width="160">
										包含以下
										<b>全部</b>的关键词
									</td>
									<td>
										<input type="text" id="includeAllKey" size="35" maxlength="100"
											/>
									</td>
								</tr>
								<tr style="display: none">
									<td width="100" colspan="2">
									</td>
									<td>
										包含以下的
										<b>完整关键词</b>
									</td>
									<td>
										<input type="text" id="includeComKey" size="35" maxlength="100"/>
									</td>
								</tr>
								<tr>
									<td width="100" colspan="2">
									</td>
									<td>
										包含以下
										<b>任意一个</b>关键词
									</td>
									<td>
										<input type="text" id="includeAnyKey" size="35" maxlength="100"/>
									</td>
								</tr>
								<tr>
									<td width="100" colspan="2">
									</td>
									<td>
										<b>不包括</b>以下关键词
									</td>
									<td>
										<input type="text" id="excludeKey" size="35" maxlength="100"/>
									</td>
								</tr>
							</table>
							<br>
							<table align="center">
								<tr>
									<td width="220"></td>
									<td width="260">
										<b>搜索结果显示条数</b>
									</td>
									<td width="300">
										选择搜索结果显示的条数
									</td>
									<td>
										<select id="termNum">
											<option value="10">每页显示10条</option>
											<option value="20">每页显示20条</option>
											<option value="50">每页显示50条</option>
											<option value="100">每页显示100条</option>
										</select>
									</td>
								</tr>
								<tr>
									<td width="100"></td>
									<td>
										<b>时间</b>
									</td>
									<td>
										限定要搜索的网页的时间是
									</td>
									<td>
										<select id="timeSpan">
											<option value="0">全部时间</option>
											<option value="2">最近一天</option>
											<option value="3">最近一周</option>
											<option value="4">最近一月</option>
											<option value="5">最近一年</option>
										</select>
									</td>
								</tr>
								<tr>
									<td width="100"></td>
									<td>
										<b>关键词位置</b>
									</td>
									<td>
										查询关键词位于
									</td>
									<td width="800">
										<input type="radio" name="searchPosition" value="0" checked>网页的任何地方
										<input type="radio" name="searchPosition" value="1">仅网页的标题中
										<input type="radio" name="searchPosition" value="2">仅在网页的URL中
										<input type="radio" name="searchPosition" value="3">仅在网页正文中
									</td>
								</tr>
								<tr>
									<td width="100"></td>
									<td>
										<b>站内搜索</b>
									</td>
									<td>
										限定要搜索指定的网站是
									</td>
									<td>
										<input type="text" name="searchSite" size="35" maxlength="100">
										<input type="submit" value=" 指定站点>> "
											onclick="return ExpandGx()" id="buttonGX">
									</td>
								</tr>
							</table>
							<table id="gxnode" style="display: none">
								<tr>
									<td width="240"></td>
									<td colspan="4">
										<table>
											<tr>
												<td width="120">
													<input type="radio" name="zl"
														onclick="clickradio(this.value)" 
														value="www.pku.edu.cn">
													<img src="images/pku.jpg" style="height: 15px; width: 15px" />
													北京大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.pku.edu.cn">
													<img src="images/tsing.jpg"
														style="height: 15px; width: 15px" />
													清华大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.scut.edu.cn">
													<img src="images/scut.jpg"
														style="height: 15px; width: 15px" />
													华南理工大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.hust.edu.cn">
													<img src="images/huazhong.jpg"
														style="height: 15px; width: 15px" />
													华中科技大学
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td width="240"></td>
									<td colspan="4">
										<table>
											<tr>
												<td width="120">
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.neu.edu.cn">
													<img src="images/dongbei.jpg"
														style="height: 15px; width: 15px" />
													东北大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.seu.edu.cn">
													<img src="images/dongnan.jpg"
														style="height: 15px; width: 15px" />
													东南大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.bupt.edu.cn">
													<img src="images/beiyou.jpg"
														style="height: 15px; width: 15px" />
													北京邮电大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.uestc.edu.cn">
													<img src="images/dianzi.jpg"
														style="height: 15px; width: 15px" />
													电子科技大学
												</td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td width="240"></td>
									<td colspan="2">
										<table>
											<tr>
												<td width="120">
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.sjtu.edu.cn">
													<img src="images/shangjiao.jpg"
														style="height: 15px; width: 15px" />
													上海交通大学
												</td>
												<td>
													<input type="radio" name="zl"
														onclick="clickradio(this.value)"
														value="www.xjtu.edu.cn">
													<img src="images/xijiao.jpg"
														style="height: 15px; width: 15px" />
													西安交通大学
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>

							<table align="center">
								<tr>
									<td width="600"></td>
									<td></td>
									<td>
										<input id="advancesubmit" type="submit" value="" />
										<br>
										<br>
									</td>
								</tr>
							</table>
						</div>
					</div>
				</td>
			</tr>
		</table>

	</form>
	<div id="copyright">
		<p>
			&nbsp;
		</p>
		<p>
			版权所有 华南理工大学广东省网络重点实验室&nbsp;

		</p>
		<p>
			Copyright (c) 2010 SCUT CCNL All Rights Reserved &nbsp;
			<a href="aboutus.jsp"><font
				style="color: #aaa; text-decoration: none">关于我们</font> </a>
		</p>
	</div>
</body>
</html>
